﻿<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%option explicit%>
<%
Dim RZ_IN
RZ_IN=1
%>
<!--#include file="../conn.inc.asp" -->
<!--#include file="admin_inc/admin.function.asp" -->
<!--#include file="admin_inc/admin.sqlfunction.asp" -->
<!-- #include file="fckeditor.asp" -->
<%
'作者：山林客（ah_bill）
'博客：http://ruizhinet.blog.163.com
'网站：http://www.ruizhinet.cn
'本信息不会影响您网站的正常访问，请保留
checkadmin(1)
dim id,typeid,addtime,author,productid,productname,content,productimg,orders,path,specialid,visible,lang,linkurl,keyword
id=GetIntQueryString("id")
typeid=GetIntQueryString("typeid")
S_LANG=GetIntQueryString("lang")
visible=1
addtime=Now()
author=Session("user_name")
If id>0 then
	dim rsa,sqla
	Set rsa = Server.CreateObject("ADODB.Recordset")
	sqla = "select * from [c_product] where id="&id
	rsa.open sqla,conn,1,1
	If rsa.eof Or rsa.bof Then 
	response.redirect("showmsg.asp?from=productlist.asp&msg=NoRecord")
	else
	productid=rsa("productid")
	productname=rsa("productname")
	content=rsa("content")
	productimg=rsa("productimg")
	author=rsa("author")
	typeid=rsa("typeid")
	orders=rsa("orders")
	path=rsa("path")
	specialid=rsa("specialid")
	addtime=rsa("addtime")
	S_LANG=rsa("lang")
	visible=rsa("visible")
	linkurl=rsa("linkurl")
	keyword=rsa("keyword")
	End If 
	rsa.close
	Set rsa=Nothing 
End If
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><%out("lang_addproduct")%></title>
<script type="text/javascript" src="admin_js/common.js"></script>
<script type="text/javascript" language="javascript" src="admin_js/net.js"></script>
<link type="text/css" href="style/style.css" rel="stylesheet" rev="stylesheet"/>
</head>
<body>
<form method="post" name="rzform" action="product_save.asp">
<table class="table_800" cellspacing="0" cellpadding="0">
<%If id>0 Then%>
<input type="hidden" name="act" value="modifysave"/>	
<input type="hidden" name="id" value="<%=id%>"/>	
<%Else%>
<input type="hidden" name="act" value="addsave"/>	
<%End If%>
<input type="hidden" name="addtime"  value="<%=addtime%>"/>
<input type="hidden" name="lang" value="<%=S_LANG%>"/>	
<tr  class="row">
	<th colspan="2">
	<%out("lang_addproduct")%>
	</th>
</tr>
<tr  class="row">
	<td><%out("lang_productname")%></td>
	<td><input type="text" name="productname" id="productname"  value="<%=productname%>" size="40"/></td>
</tr>
<tr  class="row">
	<td><%out("lang_model")%></td>
	<td><input type="text" name="productid" id="productid" size="40" value="<%=productid%>"/></td>
</tr>
<input type="hidden" name="author" value="<%=author%>"/>
<tr  class="row">
	<td><%out("lang_productphoto")%></td>
	<td>
<input type="text" name="productimg" id="productimg"  value="<%=productimg%>"  style="background-color:#CCCCCC;" id="productimg" size="30" /><input type="button" name="copyimg" value="<%out("lang_selectfromexist")%>" onclick="openWin('selectphoto.asp?photobox=productimg',840,500);"/>&nbsp;&nbsp;<span onclick="ajax_previewPhoto(document.getElementById('productimg').value);"  style="cursor:pointer;">[<%out("lang_preview")%>]</span><div style="position:relative;"><div id="photoviewer"></div></div>
<br/>
<iframe marginwidth="0" marginheight="0" frameborder="0" style="width:400px;height:30px" src="rzupload.asp?parentform=rzform&inputname=productimg" scrolling="no"></iframe>	
	</td>
</tr>
<tr  class="row">
	<td><%out("lang_protities")%></td>
	<td>
	<%out("lang_category")%>
<select name="upper" id="upper">
<%
Call ShowTypeOptions("add_modify_product",typeid,"","",2,1)
%>
</select>
&nbsp;&nbsp;
<%out("lang_special")%>
<select name="specialid">
<option value="0"><%out("lang_top_none")%></option>
<%Call ShowSpecialOption(specialid)%>	
</select>&nbsp;&nbsp;<input type="checkbox" id="visible" name="visible" value="0"  <%If visible=0 then%>checked<%End If %>/><%out("lang_visible")%>
&nbsp;&nbsp;<%out("lang_top")%><select name="orders">
		<option value="0" <%if orders=0 then%> selected="true"<%end if%>><%out("lang_top_none")%></option>
		<option value="1" <%if orders=1 then%> selected="true"<%end if%>><%out("lang_top_level1")%></option>
		<option value="2" <%if orders=2 then%> selected="true"<%end if%>><%out("lang_top_level2")%></option>
	</select><%out("lang_top_tips")%>
	</td>
</tr>
<tr  class="row">
<td><%out("lang_content")%></td>
<td>
<%
Dim sBasePath
sBasePath = Request.ServerVariables("PATH_INFO")
sBasePath = Left( sBasePath, InStrRev( sBasePath, "/" ) )
Dim oFCKeditor
Set oFCKeditor = New FCKeditor
oFCKeditor.BasePath	= sBasePath
oFCKeditor.Config("ImageBrowser") = "true" 
oFCKeditor.Value	= content
oFCKeditor.Create "content"
%>
</td>
</tr>
<tr  class="row">
	<td><%out("lang_keyword")%></td>
	<td><input type="text" name="keyword" id="keyword" size="40" value="<%=keyword%>" maxlength="100"/><%out("lang_keywordtips")%></td>
</tr>
<tr  class="row">
	<td><%out("lang_linkurl")%></td>
	<td><input type="text" name="linkurl" id="linkurl" size="80" value="<%=linkurl%>" maxlength="200"/><%out("lang_linkurltips")%>&nbsp;&nbsp;<input type="checkbox" id="makehtml" name="makehtml" value="1"/><%out("lang_makehtml")%></td>
</tr>
<tr  class="row">
	<td colspan="2" class="tdcenter"><input type="button" class="btn" onclick="checkForm('addproduct');" value="<%out("lang_save")%>"/>&nbsp;&nbsp;&nbsp;<input class="btn" type="reset" value="<%out("lang_reset")%>"/></td>
</tr>
</table>
 </form>
</body>
</html>